import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:vape_xe/routes/app_pages.dart';
import 'package:vape_xe/utils/utils.dart';
import 'package:vape_xe/values/values.dart';
import 'package:vape_xe/widgets/widgets.dart';

import 'logic.dart';

class PasswordView extends GetView<PasswordController> {
  const PasswordView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: IconButton(
          icon: const Icon(Icons.arrow_back_ios_new_rounded),
          onPressed: () => {Navigator.of(context).pop('刷新')},
        ),
      ),
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          28.hGap,
          Padding(
            padding: EdgeInsets.symmetric(horizontal: 32.w),
            child: Text(
              'New Password'.tr,
              style: const TextStyle(
                color: AppColors.secondaryText,
                fontWeight: FontWeight.bold,
              ),
            ),
          ),
          16.hGap,
          InnerContainerWidget(
            child: Padding(
              padding: EdgeInsets.only(left: 16.w),
              child: TextField(
                controller: controller.textEditingController,
                decoration: const InputDecoration(border: InputBorder.none),
                style: TextStyle(color: Colors.white, fontSize: 14.sp, fontWeight: FontWeight.bold),
              ),
            ),
          ),
          28.hGap,
          Padding(
            padding: EdgeInsets.symmetric(horizontal: 32.w),
            child: Text(
              'Re-enter password'.tr,
              style: const TextStyle(
                color: AppColors.secondaryText,
                fontWeight: FontWeight.bold,
              ),
            ),
          ),
          16.hGap,
          InnerContainerWidget(
            child: Padding(
              padding: EdgeInsets.only(left: 16.w),
              child: TextField(
                controller: controller.textEditingController,
                decoration: const InputDecoration(border: InputBorder.none),
                style: TextStyle(color: Colors.white, fontSize: 14.sp, fontWeight: FontWeight.bold),
              ),
            ),
          ),
          36.hGap,
          GestureDetector(
            onTap: () => Get.offNamedUntil(Routes.SIGN_IN, (route) => false),
            child: Container(
              height: 52.h,
              margin: EdgeInsets.symmetric(horizontal: 32.w),
              decoration: BoxDecoration(
                gradient: const LinearGradient(colors: [Color(0xff6EDEF7), Color(0xff3351EF)]),
                borderRadius: 100.radius,
              ),
              child: Center(
                child: Text(
                  'Confirmation of changes'.tr,
                  style: const TextStyle(fontFamily: 'Montserrat', fontWeight: FontWeight.bold),
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
